home *** CD-ROM | disk | FTP | other *** search
- #pragma once
- #include <stddef.h>
- #include "EventLib.h"
-
- /* items in the standard progress dialog */
- enum {
- PROGRESS_USER = 1,
- PROGRESS_STOP,
- PROGRESS_TEXT
- };
-
- /* the following are variables used while running a progress dialog, which
- is a dialog run once every few ticks while a lengthy operation
- is taking place. */
- typedef struct {
- TicksType start; /* time when progress event loop was entered */
- DialogPtr dlg; /* dialog informing user to wait */
- Str255 str; /* string to display in dialog */
- Boolean appdlg; /* true if dialog was created by application,
- so we shouldn't dispose of it */
- Boolean modal; /* if true then using a modal dialog */
- Boolean canceled; /* true if canceled operation */
- Boolean visible; /* true if the progress dialog is visible */
- size_t maxcnt; /* maximum number of times application expects
- to execute the progress event loop; this
- enables us to draw a progress indicator */
- size_t count; /* number of times dialog has been executed;
- this helps us draw the progress indicator */
- short useritm; /* item number of progress indicator */
- short textitm; /* item number of text item */
- TicksType lastRun; /* last time ProgressRun executed */
- TicksType lastEvent; /* last time we checked for events */
- TicksType lastCursor; /* last time the cursor was changed */
- TicksType lastUpdate; /* last time the dialog was updated */
- TicksType cursorInterval;/* interval to rotate cursor */
- short cursorIndex;/* index to rotating cursor */
- } ProgressType, *ProgressPtr, **ProgressHandle;
-
- Boolean ProgressValid(ProgressHandle progress);
- void ProgressUpdate(ProgressHandle progress);
- void ProgressRun(ProgressHandle progress, long done);
- void ProgressOpenDialog(ProgressHandle progress, Boolean modal);
- void ProgressPrompt(ProgressHandle progress, const char *fmt, ...);
- void ProgressReset(ProgressHandle progress, size_t max);
- ProgressHandle ProgressBegin(size_t max, CStr255 str,
- DialogPtr dlg, short useritm, short textitm);
- void ProgressEnd(ProgressHandle progress);
- const /* EventTableType */ void *ProgressEventTable(void);
- void ProgressEventTableRegister(void);
-